package com.xinchao.core.db;

import javax.sql.DataSource;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;

@Configuration
public class DataSourceConfig {
	
	@Bean(name = "dmpDS")
    @ConfigurationProperties(prefix = "spring.datasource.dmp")
    public DataSource dmpDS() {
        return DruidDataSourceBuilder.create().build();
    }
	
	@Primary
	@Bean(name = "qrtzDS")
    @ConfigurationProperties(prefix = "spring.datasource.quartz")
    public DataSource qrtzDS() {
        return DruidDataSourceBuilder.create().build();
    }
    
}
